import _ from 'lodash';
// "name": "string",
// "url": "string"
export default {
  props: {
    collectProps: {
      type: Object,
      default: () => ({
        type: 'files'
      })
    }
  },

  computed: {
    // 信息收集
    collectInfo() {
      if (this.can_do) return null;

      const { type } = this.collectProps;

      // { name, url }
      return {
        field: this.id,
        field_value: {
          [type]: _.map(
            this.upLoaderList,
            ({ url, file }) => ({ url, name: file.name })
          )
        }
      };
    }
  }
};
